﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InnovTech.Persistence
{

    /// <summary>
    /// Provides the common GRUD functions to access the pre-defined persistence object.
    /// </summary>
    /// <typeparam name="TEntity"></typeparam>
    /// <typeparam name="TID"></typeparam>
    public interface IDao<TEntity, TID> : IDisposable
        where TEntity : IEntity<TID>
    {
        void Save(params TEntity[] obj);
        void Delete(params TEntity[] obj);
        TEntity Get(TID id);
        IEnumerable<TEntity> List(Func<TEntity, bool> predicate);
    }

    /// <summary>
    /// Provides the common GRUD functions to access the persistence objects.
    /// </summary>
    public interface IDao : IDisposable
    {
        void Save(params object[] obj);
        void Delete(params object[] obj);
        T Get<T>(object id);
        IEnumerable<T> List<T>(Func<T, bool> predicate);
    }
}
